package com.mt.api.constants.enums;

import com.mt.api.util.EnumMappingUtil;
import lombok.AllArgsConstructor;
import lombok.Getter;

import java.util.Map;

/**
 * @Author: plover
 * @Date: 2020/07/07/4:21 下午
 * @Description:
 */
@Getter
@AllArgsConstructor
public enum InstoreTypeEnum {

    PRODUCT(1, "生产入库"),
    BACK(2, "退货入库"),
    ;

    private Integer code;
    private String name;

    private static final Map<Integer, InstoreTypeEnum> statusEnumMap =
            EnumMappingUtil.toMappingMap(InstoreTypeEnum.class, InstoreTypeEnum::getCode);

    public static InstoreTypeEnum ofCode(Integer code) {
        return statusEnumMap.get(code);
    }

}
